package com.hzqy.web.login;

import java.util.Enumeration;
import java.util.Observable;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 移除session的值
 * @author dead
 *
 */
public class RemoveSession extends ObserverFather {
	private static final Log LOG = LogFactory.getLog(RemoveSession.class);

	public RemoveSession(HttpServletRequest request) {
		super(request);
	}

	@Override
	public void update(Observable o, Object arg) {
		/*session.removeAttribute("area_back");//台州返回地址
		session.removeAttribute("service_back");//普通返回地址
		session.removeAttribute("activityAlert");//活动首页弹出框
		session.removeAttribute("freeAlert");//优惠活动到期提醒框
		session.removeAttribute("recomAlert");//推荐弹出框
		session.removeAttribute("back_url");//来源路径*/
		
		Enumeration e = session.getAttributeNames();
		while(e.hasMoreElements()){ 
			String sessionName = (String)e.nextElement();
			if(!SessionKey.SESSION_EPG_INFO.equals(sessionName) && !SessionKey.SESSION_PARTNER_ID.equals(sessionName)){
				session.removeAttribute(sessionName);
				LOG.debug("清除session："+sessionName);
			}
		}
	}

}
